﻿using UnityEngine;
using System.Collections;

public class ShootController : MonoBehaviour {
	public bool isGood = false;
	public GameObject rocket;

	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {

	}

	public void fire(){
		if(rocket){
			GameObject rocketObj = (GameObject)GameObject.Instantiate(rocket,transform.position,transform.rotation);
			if (isGood) {
				rocketObj.GetComponent<BulletInfo>().isGood = true;	
			} else {
				rocketObj.GetComponent<BulletInfo>().isGood = false;		
			}
		}
	}
}
